package constants.ws;

import com.google.gson.JsonArray;

import java.util.List;

/**
 * Created by admin on 2016/7/11.
 */
public class ResultBean {

    /**
     * 状态码, 0 表示正常, 非零 表示错误
     */
    public int errorCode;

    /**
     * 数据
     */
    public Object data;

    /**
     * 分页
     */
    public PageBean page;

    public ResultBean(int errorCode, Object data) {
        this.errorCode = errorCode;
        this.data = data;
    }

    public ResultBean(int errorCode, JsonArray data, PageBean pageBean) {
        this.errorCode = errorCode;
        this.data = data;
        this.page = pageBean;
    }

    public ResultBean(int errorCode, List data, PageBean pageBean) {
        this.errorCode = errorCode;
        this.data = data;
        this.page = pageBean;
    }

    public ResultBean(int errorCode, List data, int page, int size) {
        this.errorCode = errorCode;
        this.data = data;
        this.page = new PageBean();
        this.page.page = page;
    }

}
